home *** CD-ROM | disk | FTP | other *** search
/ TOS Silver 2000 / TOS Silver 2000.iso / programm / GNUC / UTIL-41S.LZH / util-41 / cross-inc / compiler.h next >
Encoding:
C/C++ Source or Header  |  1998-10-05  |  5.5 KB  |  235 lines

  1. /* compiler specific defines */
  2. /* this file is guaranteed to be included exactly once if you include
  3.    anything at all. all site-dependent or compiler-dependent stuff
  4.    should go here!!!
  5.  */
  6.  
  7. #ifndef _COMPILER_H
  8. #define _COMPILER_H
  9.  
  10. /* symbol to identify the library itself */
  11. #ifndef __MINT__
  12. #define __MINT__
  13. #endif
  14.  
  15. /* symbols to identify the type of compiler */
  16.  
  17. #ifdef __SOZOBONC__
  18. #define __SOZOBON__ __SOZOBONC__
  19. #else
  20. # ifdef SOZOBON
  21.   /* The "real" Sozobon, as distinct from HSC.  Don't want to assume any
  22.      features about it, so set version number to 0. */
  23. # define __SOZOBON__ 0
  24. # endif
  25. #endif
  26.  
  27. #ifdef LATTICE
  28. #define __LATTICE__
  29. #endif
  30.  
  31. /* general library stuff */
  32. /* __SIZE_TYPEDEF__:     the type returned by sizeof() */
  33. /* __PTRDIFF_TYPEDEF__: the type of the difference of two pointers */
  34. /* __WCHAR_TYPEDEF__:     wide character type (i.e. type of L'x') */
  35. /* __EXITING:           the type of a function that exits */
  36. /* __NORETURN:          attribute of a function that exits (gcc >= 2.5) */
  37. /* __CDECL:             function must get parameters on stack */
  38.         /* if !__CDECL, passing in registers is OK */
  39.  
  40. /* symbols to report about compiler features */
  41. /* #define __NEED_VOID__    compiler doesn't have a void type */
  42. /* #define __MSHORT__        compiler uses 16 bit integers */
  43. /* (note that gcc and C68 define this automatically when appropriate) */
  44.  
  45. #ifdef __GNUC__
  46. #if __GNUC__ > 1
  47. #define __SIZE_TYPEDEF__ __SIZE_TYPE__
  48. #define __PTRDIFF_TYPEDEF__ __PTRDIFF_TYPE__
  49. #ifdef __GNUG__
  50. /* In C++, wchar_t is a distinct basic type,
  51.    and we can expect __wchar_t to be defined by cc1plus.  */
  52. #define __WCHAR_TYPEDEF__ __wchar_t
  53. #else
  54. /* In C, cpp tells us which type to make an alias for.  */
  55. #define __WCHAR_TYPEDEF__ __WCHAR_TYPE__
  56. #endif
  57. #else
  58. #ifndef sun
  59. #  define __SIZE_TYPEDEF__ unsigned long
  60. #  define __PTRDIFF_TYPEDEF__ long
  61. #  define __WCHAR_TYPEDEF__ int
  62. #else
  63.    /* sun always seems to have an agenda of their own */
  64. #  include <sys/stdtypes.h>
  65. #  define __SIZE_TYPEDEF__ int          /* can you believe this!! */
  66. #  define __PTRDIFF_TYPEDEF__ int       /* or this!! */
  67. #  define __WCHAR_TYPEDEF__ unsigned short /* this seems reasonable */
  68. #  define _SIZE_T __SIZE_TYPEDEF__
  69. #  define _WCHAR_T __WCHAR_TYPEDEF__
  70. #endif
  71. #endif
  72. #if (__GNUC__ == 2) && (__GNUC_MINOR__ >= 5) /* false for gcc < 2.5 */
  73. #define __NORETURN __attribute__ ((noreturn))
  74. #define __EXITING void
  75. #else
  76. #define __EXITING volatile void
  77. #endif
  78. #define __VA_LIST__ void *
  79. #ifndef __NO_INLINE__
  80. # define __GNUC_INLINE__
  81. #endif
  82. #endif
  83.  
  84. #ifdef __LATTICE__
  85. #define __SIZE_TYPEDEF__ unsigned long
  86. #define __PTRDIFF_TYPEDEF__ long
  87. #define __WCHAR_TYPEDEF__ char
  88. #define __EXITING void
  89. #define __CDECL __stdargs
  90. #ifdef _SHORTINT
  91. # define __MSHORT__
  92. #endif
  93. #ifdef _UNSIGNEDCHAR
  94. # define __CHAR_UNSIGNED__
  95. #endif
  96. #endif
  97.  
  98. #ifdef __C68__
  99. #define __SIZE_TYPEDEF__ unsigned long
  100. #define __PTRDIFF_TYPEDEF__ long
  101. #define __WCHAR_TYPEDEF__ char
  102. #define __EXITING void
  103. #endif
  104.  
  105. #ifdef __SOZOBON__
  106. /*
  107.  * Temporary hacks to overcome 1.33i's short symbol names.  As of 2.01i,
  108.  * this restriction is removed, but can be reinstated for compatibility
  109.  * via the -8 compiler flag.  -- sb 5/26/93
  110.  */
  111. #if __SOZOBON__ < 0x201 || !defined(__HSC_LONGNAMES__)
  112. #  define _mallocChunkSize _sc_mCS
  113. #  define _malloczero _sc_mz
  114. #  define _console_read_byte _sc_crb
  115. #  define _console_write_byte _sc_cwb
  116. #endif
  117.  
  118. #define __NULL (0L)
  119. #if __SOZOBON__ < 0x122        /* previous versions didn't grok (void *) */
  120. #  define void char
  121. #endif
  122. #define __SIZE_TYPEDEF__ unsigned int
  123. #define __PTRDIFF_TYPEDEF__ long
  124. #define __WCHAR_TYPEDEF__ char
  125. #define __EXITING void
  126. #if __SOZOBON__ < 0x201        /* 2.01 now #define's this */
  127. #  define __MSHORT__
  128. #endif
  129. #endif /* __SOZOBON__ */
  130.  
  131. #ifdef __TURBOC__
  132. #ifndef __STDC__
  133. #  define __STDC__ 1
  134. #endif
  135. #define __SIZE_TYPEDEF__ unsigned long
  136. #define __PTRDIFF_TYPEDEF__ long
  137. #define __WCHAR_TYPEDEF__ char
  138. #define __EXITING void
  139. #define __MSHORT__
  140. #define __VA_LIST__ void *
  141. #define __CDECL cdecl
  142. /* As long as we haven't ported gemlib to Pure C and hence have to use
  143.  * Turbo's/Pure's GEM library, define the next:
  144.  */
  145. #define __TCC_GEMLIB__
  146. #endif /* __TURBOC__ */
  147.  
  148. #if defined(__hpux) && (!defined(__GNUC__))
  149. #define __SIZE_TYPEDEF__ unsigned int
  150. #define __PTRDIFF_TYPEDEF__ int
  151. #define __WCHAR_TYPEDEF__ unsigned int
  152. #define __EXITING void
  153. #endif
  154.  
  155. /* some default declarations */
  156. /* if your compiler needs something
  157.  * different, define it above
  158.  */
  159. #ifndef __VA_LIST__
  160. #define __VA_LIST__ char *
  161. #endif
  162.  
  163. #ifndef __CDECL
  164. #define __CDECL
  165. #endif
  166.  
  167. #ifndef __NORETURN
  168. #define __NORETURN
  169. #endif
  170.  
  171. #ifndef __NULL
  172. #  ifdef __MSHORT__
  173. #    define __NULL ((void *)0)
  174. #  else
  175.      /* avoid complaints about misuse of NULL :-) */
  176. #    define __NULL (0)
  177. #  endif
  178. #endif
  179.  
  180. #ifdef __cplusplus
  181. # define __EXTERN
  182. # define __PROTO(x) x
  183. #else
  184. # ifdef __STDC__
  185. #  ifndef __NO_PROTO__
  186. #    define __PROTO(x) x
  187. #  endif
  188. #  define __EXTERN
  189. # else
  190. #  define __EXTERN extern
  191. /*
  192.  * fudge non-ANSI compilers to be like ANSI
  193.  */
  194. #  define const
  195. #  define volatile
  196.  
  197. #  ifdef __NEED_VOID__
  198. typedef char void;    /* so that (void *) is the same as (char *) */
  199.     /* also lets us know that foo() {...} and void foo() {...} are
  200.        different */
  201. #  endif
  202. # endif /* __STDC__ */
  203. #endif /* __cplusplus */
  204.  
  205. #ifndef __PROTO
  206. #define __PROTO(x) ()
  207. #endif
  208.  
  209. /* macros for POSIX support */
  210. #ifndef __hpux
  211. #define _UID_T unsigned short
  212. #define _GID_T unsigned short
  213. #define _PID_T int
  214. #define _POSIX_VERSION 1
  215. #endif
  216.  
  217. /* used in limits.h, stdio.h */
  218. #define    _NFILE        (32)        /* maximum number of open streams */
  219.  
  220. #endif /* _COMPILER_H */
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.